<template>
	<view>
			<button open-type="getUserInfo" @click="getUser">微信登录</button>
			
	</view>
</template>

<script>
	export default {
		data() {
			return {
				
			}
		},
		methods: {
			getUser(){	
				//#ifdef MP-WEIXIN
				wx.getUserProfile({
					desc:'完善用户资料',
					success:(res)=>{
						console.log(res);
						wx.setStorage({
							key:'userInfo',
							data:JSON.stringify(res.userInfo)
						})
						uni.reLaunch({
							url:'../../mine/mine'
						})
					},
					fail:(err)=>{
						// Toast('提示内容');
					}
				})
				// #endif
			}
		}
	}
</script>

<style>

</style>

